The Ziggurat Algorithm is a very fast rejection sampling method forgenerating PseudoRandom Numbers (PRNs) from common statistical distributions.The algorithm divides a distribution into rectangular layers that stack on topof each other (resembling a Ziggurat), subsuming the desired distribution.Random values within these rectangular layers are then sampled by rejection.This implementation splits layers into two types: those constituting themajority that fall completely under the distribution and can be sampledextremely fast without a rejection test, and a few additional layers thatencapsulate the fringe of the distribution and require a rejection test. Thismethod offers speedups of 65% for exponentially- and 82% fornormally-distributed PRNs when compared to the best available C implementationsof these generators. Even greater speedups are obtained when the algorithm isextended to the Python and MATLAB/OCTAVE programming environments.
展开▼